package com.situ.day1.cal;

public class CalDemo {
    public static void main(String[] args) {
        Add add = new Add();
        add.setNum1(3);
        add.setNum2(5);
        int result1 = add.getResult();
        System.out.println(result1);

        Add add2 = new Add(3, 5);

        Cal cal = new Add(3, 5);
        int result2 = cal.getResult();
        System.out.println(result2);
        cal = new Sub(4, 5);
        int result3 = cal.getResult();
        System.out.println(result3);

        jiSuan(add);
    }

    public static void jiSuan(Cal cal) {
        cal.getResult();
    }

    /*public static void jiSuan(Sub sub) {

    }

    public static void jiSuan(Add add) {

    }*/

}
